#ifndef _ADC_VALUE_H
#define _ADC_VALUE_H
#include "main.h"
#include "stdint.h"
#define REGISTER_SAMPLE 0.003F
#define CENTER_ADC 2542.f
#define ADC_RAGNE 4095.F
typedef struct{
	uint32_t adc_A;
	uint32_t adc_B;
	uint32_t adc_C;
	uint32_t adc_spd_ref;
	uint32_t adc_V_bus;
	uint32_t adc_TEMP;
}adc_origin_t;

typedef struct{
	float _cur_A;
	float _cur_B;
	float _cur_C;
	float adc_spd_ref_RPM;
	float voltage_BUS;
	float voltage_TEMP;
}adc_transform_t;
extern uint16_t adc_dma_data[3];
extern uint16_t adc_offset_flag;
extern adc_origin_t adc_origin;
extern adc_transform_t adc_transform;
void read_adc(ADC_HandleTypeDef* adc1,ADC_HandleTypeDef* adc2,adc_origin_t* ori);
void adc_offset_cal(void);
void cal_volatge_tran(adc_origin_t* ori,adc_transform_t* tra);
#endif 

